package com.optimatch.ui.controler.actions;

import java.awt.event.ActionEvent;
import java.io.File;

import com.optimatch.model.io.ReadXMLTeams;
import com.optimatch.ui.controler.localization.Constants;
import com.optimatch.ui.controler.localization.LanguageManager;
import com.optimatch.ui.model.Model;
import com.optimatch.ui.model.beans.Probleme;
import com.optimatch.ui.view.View;

public class AddProblemFromFile extends Action {

	public AddProblemFromFile(Model model, View view, ListAction actions) {
		super(model, view, actions);
		putValue(Action.NAME, LanguageManager.getBundle()
				.getString(Constants.OPEN_FILE_MENU_ITEM));
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		File file = view.getMenu().getFile();
		Probleme problem = model.getProbleme();
		ReadXMLTeams.readTeams(file.getAbsolutePath(),model);
	}

}
